<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    #btn {
      width: 60px;
      height: 30px;
      /* border: 1px solid; */
      display: flex;
      justify-content: center;
      align-items: center;
      cursor: pointer;
      box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04)
    }
  </style>
</head>
<body>
  <div id="app"></div>
  <div id="btn">++</div>
  
  <script src="https://unpkg.com/@vue/reactivity@3.0.5/dist/reactivity.global.js"></script>
  <!-- <script src="./compiler/index.js"></script> -->

  <script type="module">
    import { renderer } from './compiler/index.js'

    const { effect, ref } = VueReactivity

    const count = ref(0)

    const vnode = {
      type: 'div',
      props: {
        id: 'foo',
      },
      children: [
        {
          type: 'h1',
          children: 'hello'
        },
        {
          type: 'input',
          props: {
            form: 'form1'
          }
        }
      ]
    }

    // const container = {
    //   type: 'root'
    // }
    const container = document.querySelector('#app')

    effect(() => {
      renderer.render(vnode, container)
    })

    btn.addEventListener('click', () => {
      count.value++
    })

  </script>
</body>
</html>
